instead of this: $(".editBtn").on("click", function(){ //do something }); use this; $("body").on("click", ".editBtn", function(){ //do something });